package com.platform.vo;

import com.google.common.collect.Maps;
import lombok.Data;

import java.util.Map;

/**
 * 功能描述: 导入数据传输类
 *
 * @author tommy modify on 2019-06-04-9:21
 */
@Data
public class ImportDto {
    // 重源数据查出来的值
    private Map<String,Object> bucket = Maps.newLinkedHashMap();
    // 更新目标数据前的旧数据
    private Map<String,Object> oldData = Maps.newLinkedHashMap();
    // 处理后用于目标数据的值
    private Map<String,Object> result = Maps.newLinkedHashMap();
    private boolean flag = true;
    private String  errMsg = "未知错误";
    // 参考数据交换，更新还是新增数据标志位
    private boolean insertFlag = false;
    private boolean updateFlag = false;
    private boolean testFlag = false;

    public Object getData(String key){
        return bucket.get(key);
    }

    public Object getResult(String key){
        return result.get(key);
    }

    public void setData(String key, String inData){
        bucket.put(key, inData);
    }

    public void setData(String key, Object inData){
        bucket.put(key, inData);
    }

    public void setResult(String key, String inData){
        result.put(key, inData);
    }

    public void setResult(String key, Object inData){
        result.put(key, inData);
    }

    public void putAll(Map<String, Object> map) {
        bucket.putAll(map);
    }

    public void putResultAll(Map<String, Object> map) {
        result.putAll(map);
    }

    public Map<String, Object> getBucket() {
        return bucket;
    }

    public Map<String, Object> getOldData() {
        return oldData;
    }
}
